# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-aiopg
pkgver=1.4.0
pkgrel=2
pkgdesc="Library for accessing a PostgreSQL database from the asyncio framework"
url="http://aiopg.readthedocs.io/"
arch="noarch"
license="BSD-2-Clause"
options="!check" # docker requiered
depends="python3 py3-psycopg2 py3-async-timeout"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-timeout py3-docker-py py3-sqlalchemy docker"
subpackages="$pkgname-doc $pkgname-pyc"
source="aiopg-$pkgver.tar.gz::https://github.com/aio-libs/aiopg/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/aiopg-$pkgver"

build() {
	python3 setup.py build
}

check() {
	dockerd
	export PYTHONPATH="build/lib:$PYTHONPATH"
	make test
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"

	install -Dm644 README.rst -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
cbb28b0b15eb89fa3162e59e3e88dac18bddbad3d95458b5c3eb487d15767c26810e941f83c3478cac8a8a085b23723690c8d294bf6aac433a14c3defcef1138  aiopg-1.4.0.tar.gz
"
